<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/9
 * Time: 15:08
 */

namespace app\index\controller;


use app\common\controller\Frontend;
use app\common\model\ArticleModel;
use app\common\model\Notice;
use app\common\model\Promotion;
use think\Request;

class Notices extends Frontend
{

    protected $noNeedLogin = '*';
    protected $noNeedRight = '*';
    protected $layout = '';

    public function read(Request $request)
    {
        //Promotion::doPromotion(1);
        $id = $request->request('notice_id');
        try {
            $notice = Notice::where('id', $id)->find();
            if (empty($notice)) {
                exception('未找到通知');
            }

            return $this->view->fetch('read', ['detail' => $notice]);
        } catch (\Exception $exception) {
            return $exception->getMessage();
        }

    }
}